<template>
	<div id="app">
		<!-- <router-view v-if="$route.meta.keepAlive"></router-view> -->
		<keep-alive><router-view v-if="$route.meta.keepAlive && isRouterAlive"></router-view></keep-alive>
		<router-view v-if="!$route.meta.keepAlive && isRouterAlive"></router-view>
	</div>
</template>

<script>
export default {
	name: 'app',
	provide() {
		return {
			reload: this.reload
		};
	},
	data() {
		return {
			isRouterAlive: true
		};
	},
	mounted: function() {
		console.log('mounted');
	},
	created: function() {
		console.log('created');
	},
	methods: {
		reload() {
			this.isRouterAlive = false;
			this.$nextTick(() => {
				this.isRouterAlive = true;
			});
		}
	}
};
</script>

<style>
@import './assets/css/global.css';
@import './assets/css/all.css';
@import './assets/font/iconfont.css';
</style>
